import java.math.BigInteger;


public class Id implements Node{
	public String token = "<id>";
	public String id = null;
			
	public Id(){
		// first token should be an id
		int token = PSTree.Core_TK.getToken();	
		if(token != 32){
			System.out.println("NOT ID:" + token);
			System.out.println("Expecting identifier");
			System.exit(1);
		}
		String id = PSTree.Core_TK.idName();
		//System.out.println("id "+id);
		// insert value to symbol table
		
		this.id = id;
		
		PSTree.Core_TK.skipToken(); // skip the id Token
		
	}

	@Override
	public void print(int indent) {
		
		System.out.print(this.id);
		
	}

	
	public void execute() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public BigInteger intexecute() {
		//if on declaration sequence, add to symbol table.
	
		if(PSTree.DS){
			//System.out.println("id exec: " +this.id);
			symbolTable.add(this.id, null);
		}
		return null;
	}

	@Override
	public boolean compexecute() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public String Stringexcec() {
		// TODO Auto-generated method stub
		return null;
	}

}
